home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / pwrbat23.zip / INQUIRE.PWR < prev    next >
Text File  |  1996-05-09  |  5KB  |  188 lines

  1.     ; Current color variables
  2. Variable    ForeColor,3
  3. Variable    BackColor,3
  4. Variable    Composite,3
  5.  
  6.     ; Current directory variables
  7. Variable    CurrDrive,1,''
  8. Variable    CurrDirectory,255
  9.  
  10.     ; Current date variables
  11. Variable    DayOfWeek,10
  12. Variable    Month,2
  13. Variable    Day,2
  14. Variable    Year,4
  15.  
  16.     ; Disk Information variables
  17. Variable    VolID,12
  18. Variable    DriveType,10
  19.  
  20.     ; Disk space variables
  21. Variable    TotalSpace,11
  22. Variable    FreeSpace,11
  23.  
  24.     ; Environment variable variables
  25. Variable    EnvironLabelName,12
  26. Variable    EnvironNameValue,255
  27.  
  28.     ; FileExpand variables
  29. Variable    FileName,64
  30.  
  31.     ; FileSize variables
  32. Variable    FileSize,11
  33.  
  34.     ;Time variables
  35. Variable    CurrentTime,11
  36.  
  37.     ; Working variables
  38. Variable    CLP%1,1
  39. Variable    Work,255
  40. Variable    InChar,1
  41. Variable    SpecChar,1
  42. Variable    Normal,1,1
  43. Variable    Off,1,2
  44. Variable    Color1,3,112
  45. Variable    Color2,3,96
  46. Variable    Color3,3,116
  47. Variable    Color4,3,30
  48. Variable    Color5,3,31
  49. Variable    Color6,3,14
  50. Variable    Color7,3,12
  51. Variable    Color8,3,95
  52. Variable    MonitorType,1
  53. Variable    PressAnyKey,25,'244Press Any Key To Exit'
  54.  
  55.     ; Does the user want instructions
  56. Compare     CLP%1,'?',ChkSwt,ChkSwt
  57. Writeline    ''
  58. Writeline    'Enter INQUIRE M to force monochrome colors'
  59. Writeline    ''
  60. Halt
  61.  
  62. Label    ChkSwt
  63.     ; Do we force to mono colors
  64. Upper        CLP%1
  65. Compare     CLP%1,'M',,,MonoColors
  66.     ; Do we have a color monitor
  67. SetVar        MonitorType,DispAdapter
  68. Compare     MonitorType,'C',,,ColorMon
  69.  
  70.     ; Set the colors to show on mono screen
  71. Label    MonoColors
  72. SetVar        Color1,7
  73. SetVar        Color2,7
  74. SetVar        Color3,7
  75. SetVar        Color4,7
  76. SetVar        Color5,7
  77. SetVar        Color6,7
  78. SetVar        Color7,7
  79. SetVar        Color8,7
  80.  
  81. Label    ColorMon
  82.     ; Query the system for the current color defined to DOS
  83. ?Color      ForeColor,BackColor,Composite
  84.  
  85.     ; Clear the screen to black on gray with a red border
  86. Cursor        Off
  87. Window2     1,1,80,25,Color1        ;enable us to clear inside of box with char
  88. Clear        Color1,,'░'
  89. Window0     1,1,80,25,Color1        ;set the window back to normal
  90.  
  91.     ; What is the current date
  92. Color       Color3
  93. ?Date       DayOfWeek,Month,Day,Year
  94. Concat      Work,'Today is ',DayOfWeek
  95. Concat      Work,', '
  96. Concat      Work,Month
  97. Concat      Work,'/'
  98. Concat      Work,Day
  99. Concat      Work,'/'
  100. Concat      Work,Year
  101. WriteAt     3,1,Work
  102.  
  103.     ; Get the current time
  104. ?Time        CurrentTime
  105. WriteAt     67,1,CurrentTime
  106.  
  107.     ; Display the current color
  108. Box4        3,3,18,7,Color1,,7
  109. WriteAt     4,3,'Current  Color',Color1
  110. Concat        Work,'Foreground ',ForeColor
  111. WriteAt     4,4,Work,Color1
  112. Concat        Work,'Background ',BackColor
  113. WriteAt     4,5,Work,Color1
  114. Concat        Work,'Composite ',Composite
  115. WriteAt     4,6,Work,Color1
  116.  
  117.     ; What is the current directory on the specified drive
  118. Box4        21,3,77,5,Color2,,7
  119. ?CurrDir    CurrDrive,CurrDirectory
  120. Concat        Work,' Current Defined Directory For Drive ',CurrDrive
  121. Concat        Work,': '
  122. WriteAt     30,3,Work,Color2
  123. WriteAt     22,4,CurrDirectory,Color2
  124.  
  125.     ; Demonstrate the check for valid directory
  126.     ; Use the current directory we know is valid
  127. ?DirExist   CurrDirectory,DirExists
  128. Writeline    'This directory does not exist...'  ;we dont expect this
  129. Halt        '100'                               ;for bad directory
  130. Label    DirExists
  131.  
  132.     ; What type is drive is this
  133. Box4        3,10,30,15,Color4,,7
  134. Concat        Work,' Drive Info For ',CurrDrive
  135. Concat        Work,': '
  136. WriteAt     7,10,Work,Color4
  137. ?DiskInfo   CurrDrive,VolID,DriveType
  138. Concat        Work,'Type ',DriveType
  139. WriteAt     4,11,Work,Color5
  140. Concat        Work,'Volume ID ',VolID
  141. WriteAt     4,12,Work,Color5
  142.  
  143.     ; Check the disk space
  144. ?DiskSpac   CurrDrive,TotalSpace,FreeSpace
  145. Concat        Work,'Total Space ',TotalSpace
  146. WriteAt     4,13,Work,Color5
  147. Concat        Work,'Free Space ',FreeSpace
  148. WriteAt     4,14,Work,Color5
  149.  
  150.     ; Retrieve an environment variable (PATH)
  151. Box4        3,19,77,22,Color6,,7
  152. WriteAt     28,19,' Environment  Variables ',Color6
  153. Color        Color7
  154. SetVar      EnvironLabelName,'PATH'
  155. ?EnvStr     EnvironLabelName,EnvironNameValue
  156. WriteAt     5,20,EnvironNameValue,Color7
  157. ?EnvStr     'COMSPEC',EnvironNameValue
  158. WriteAt     5,21,EnvironNameValue,Color7
  159.  
  160.     ; Find a file and report the full directory path
  161.     ; Look for COMMAND.COM
  162. Box4        33,10,77,13,Color8,,7
  163. SetVar        FileName,EnvironNameValue
  164. Concat        EnvironNameValue,' ',EnvironNameValue,' '
  165. WriteAt     35,10,EnvironNameValue,Color8
  166. ?FileExpand FileName,FileFound
  167. Concat        Work,FileName,' not found on your system'
  168. WriteAt     34,11,Work,Color8
  169. GoTo        FileSize
  170. Label    FileFound
  171. WriteAt     34,11,FileName,Color8
  172.  
  173.     ; Check the size of a specified file. Use COMMAND.COM again
  174. Label   FileSize
  175. ?FileSize    FileSize,FileName
  176. Concat        Work,'Size ',FileSize
  177. Concat        Work,' bytes...'
  178. WriteAt     34,12,Work,Color8
  179. Center        PressAnyKey,25
  180. Label    TimeLoop
  181. ?Time        CurrentTime
  182. WriteAt     67,1,CurrentTime,Color3
  183. ReadKey     InChar,,1
  184. Compare     InChar,'',,,TimeLoop
  185. Cursor        Normal
  186. Color        Composite
  187. Clear        Composite,,,0
  188.